package com.hc.componentspringboot.repository;

import com.hc.componentspringboot.bean.Authority;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AuthorityRespository extends JpaRepository<Authority,Integer> {
    @Query(value = "select a.* from t_customer c,t_authority a,t_customer_authority ca " +
            "where ca.customer_id=c.id and ca.authority_id=a.id and c.username=?1",nativeQuery = true)
    List<Authority> findAuthoritysByUsername(String username);
}
